package com.usian.controller;

import com.github.pagehelper.PageInfo;
import com.usian.entity.PageResult;
import com.usian.entity.QueryPageBean;
import com.usian.pojo.Number;
import com.usian.service.NumberService;
import net.sf.jsqlparser.parser.JJTCCJSqlParserState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/number")
public class NumberController {

    @Autowired
    private NumberService numberService;


    @RequestMapping("/findAll")
    public PageInfo<Number> findAll(Integer page, Integer size, Number number){
        if (null == page){
            page = 1;
        }
        if (null == size){
            size = 2;
        }
        return numberService.findAll(page,size,number);
    }

    @RequestMapping("/add")
    public void add(@RequestBody Number number){
        numberService.add(number);
    }

    @RequestMapping("/etid")
    public void etid(@RequestBody Number number){
        numberService.etid(number);
    } @RequestMapping("/del")
    public void del(Integer id){
        numberService.del(id);
    }


}
